// 计算3次考试的平均成绩: 使用循环

#include <iostream>
using namespace std;

int main() {
    float sc1;
    float sc2;
    float sc3;
    float ave;

    char ch = 'y';
    while ('y' == ch) {
        cout << "请输入3次考试的成绩: ";
        cin >> sc1 >> sc2 >> sc3;

        ave = (sc1 + sc2 + sc3) / 3.0f;
        cout << "3次考试的平均成绩是 " << ave << "\n";

        cout << "是否继续计算? y=是, n=否: ";
        cin >> ch;
    }
}